//
//  XWalletReadyViewController.m
//  Bees
//
//  Created by Xiaohan on 2018/12/24.
//  Copyright © 2018 xiaohan. All rights reserved.
//

#import "XWalletReadyViewController.h"
#import "ImportTheWalletViewController.h"
#import "CreatWalletViewController.h"
@interface XWalletReadyViewController ()
@end

@implementation XWalletReadyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}

- (void)setupUI{
    self.navigationBarHidden = YES;
    
    UILabel*tipLab = [UILabel new];
    tipLab.text = XLocalized(@"您是否有账号?");
    tipLab.font = kBoldFont(24);
    [self.contentView addSubview:tipLab];
    [tipLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kNormalSpace);
        make.top.mas_equalTo(0);
    }];
    UILabel*tipLab2 = [UILabel new];
    tipLab2.text = XLocalized(@"钱包体系");;
    tipLab2.font = kBoldFont(15);
    tipLab2.textColor = UIColorHex(#666666);
    [self.contentView addSubview:tipLab2];
    [tipLab2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kNormalSpace);
        make.top.equalTo(tipLab.mas_bottom).offset(AdaptedWidth(25));
    }];
    
    FlatButton *listBtn = [FlatButton button];
    ViewBorderRadius(listBtn, AdaptedWidth(10), CGFloatFromPixel(2), kColorMain);
    listBtn.titleLabel.font = kBoldFont(13);
//    [listBtn setImage:IMAGE_NAMED(@"black_sanjiao") forState:UIControlStateNormal];
    [listBtn setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
    [self.contentView addSubview:listBtn];
    [listBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tipLab2.mas_right).offset(AdaptedWidth(10));
        make.centerY.equalTo(tipLab2.mas_centerY);
        make.width.mas_greaterThanOrEqualTo(AdaptedWidth(70));;
        make.height.mas_equalTo(AdaptedWidth(30));
    }];
    
    [listBtn setTitle:kSymbolName_EOS forState:UIControlStateNormal];
//    [listBtn layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight imageTitleSpace:AdaptedWidth(8)];
    
    FlatButton *HAVE_ACCOUNT = [FlatButton button];
    [HAVE_ACCOUNT setBackgroundImage:IMAGE_NAMED(@"HAVE_ACCOUNT") forState:UIControlStateNormal];
    [self.contentView addSubview:HAVE_ACCOUNT];
    [HAVE_ACCOUNT mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kNormalSpace);
        make.right.mas_equalTo(-kNormalSpace);
        make.top.equalTo(tipLab2.mas_bottom).offset(AdaptedWidth(35));
        make.height.mas_equalTo(AdaptedWidth(100));
    }];
    FlatButton *NO_ACCOUNT = [FlatButton button];
    [NO_ACCOUNT setBackgroundImage:IMAGE_NAMED(@"NO_ACCOUNT") forState:UIControlStateNormal];
    [self.contentView  addSubview:NO_ACCOUNT];
    [NO_ACCOUNT mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kNormalSpace);
        make.right.mas_equalTo(-kNormalSpace);
        make.top.equalTo(HAVE_ACCOUNT.mas_bottom).offset(AdaptedWidth(13));
        make.height.mas_equalTo(AdaptedWidth(100));
        make.bottom.mas_equalTo(AdaptedWidth(-100));
    }];
    
    kWeakSelf(self);
    [NO_ACCOUNT addTapBlock:^(UIButton * _Nonnull btn) {
        CreatWalletViewController *vc = [CreatWalletViewController new];
        [weakself.navigationController pushViewController:vc animated:YES];
    }];
    
    [HAVE_ACCOUNT addTapBlock:^(UIButton * _Nonnull btn) {
        ImportTheWalletViewController *vc = [ImportTheWalletViewController new];
        [weakself.navigationController pushViewController:vc animated:YES];
    }];
}

@end
